<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <cpn1></cpn1>
        <cpn2></cpn2>
    </div>
</body>
<script src='../js/vue.js'></script>
<script>
    // 1.全局注册的语法糖
    // const cpn1 = Vue.extend(),
    Vue.component('cpn1', {
        template: `
            <div>
                <h2>
                    我是哈哈哈
                </h2> 
            </div>
        `
    })
    let app = new Vue({
        el: '#app',
        data: {
            msg: 'hello vue.js'
        },
        methods: {},
        // 2.局部注册的语法糖
        components:{
            'cpn2':{
        template: `
            <div>
                <h2>
                    我是呵呵呵
                </h2> 
            </div>
        `
    }
        }
    })
</script>

</html>